package com.atguigu.gmall.feign.cart;

import com.atguigu.gmall.cart.entity.CartInfo;
import com.atguigu.gmall.cart.vo.AddCartSuccessVo;
import com.atguigu.gmall.common.result.Result;
import com.atguigu.gmall.product.entity.SkuInfo;
import feign.Request;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@FeignClient("service-cart")
@RequestMapping("/api/inner/rpc/cart")
public interface CartFeignClient {
    @GetMapping("/add/{skuId}/{skuNum}")
   Result<SkuInfo> addToCart(@PathVariable("skuId") Long skuId,
                             @PathVariable("skuNum") Integer skuNum, Request.Options options);

    /**
     * 删除选中的
     * @return
     */
    @DeleteMapping("/deleteChecked")
    Result deleteChecked();

    /**
     * 获取所有选中的商品
     * @return
     */
    @GetMapping("/checkeds")
    Result<List<CartInfo>> getChecked();


}
